package roborally.Exceptions;

import roborally.Placeable;
import roborally.Robot;
import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;
import be.kuleuven.cs.som.annotate.Raw;

/**
 * A class of exceptions signaling illegal destination coordinates.
 * Each illegal destination exception involves the illegal destination coordinate and the original coordinate.
 * 
 * @version 1.36
 * @author Michiel Ruelens & Dieter Naten
 */

public class IllegalDestinationException extends RuntimeException {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * Variable referencing the robot of this illegal destination exception.
	 */
	private final Placeable placeable;
	/**
	 * Variable referencing the destination coordinate of this illegal destination exception.
	 */
	private final long destinationCoordinate;
	/**
	 * Variable referencing the type of coordinate of this illegal destination exception.
	 */
	private final String type;
	
	/**
	 * Initialize this new illegal destination exception with the given original coordinate, original coordinate and type.
	 * 
	 * @param 	robot
	 * 			The robot that was intended to move.
	 * @param	destinationCoordinate
	 * 			The coordinate that the robot was intended to move to.
	 * @post	The robot of this new illegal destination exception is equal to the given robot.
	 * 			| new.getRobot() == robot
	 * @post	The destination coordinate of this new illegal destination exception is equal to the given destination coordinate.
	 * 			| new.getDestination() == destinationCoordinate
	 * @post	The type of this illegal destination exception is equal to the given type.
	 * 			| new.getType() == type
	 * @effect 	This illegal amount exception is further initialized as a new runtime exception involving no diagnostic message and no cause.
	 * 			| super()
	 */
	public IllegalDestinationException (Placeable placeable, long destinationCoordinate, String type)
	{
		this.placeable = placeable;
		this.destinationCoordinate = destinationCoordinate;
		this.type = type;
	}
	
	/**
	 * Return the robot of this illegal destination exception
	 */
	@Basic @Raw @Immutable
	public Placeable getPlaceable()
	{
		return placeable;
	}
	
	/**
	 * Return the destination coordinate of this illegal destination exception
	 */
	@Basic @Raw @Immutable
	public long getDestination()
	{
		return destinationCoordinate;
	}
	
	/**
	 * Return the type of this illegal destination exception
	 */
	@Basic @Raw @Immutable
	public String getType()
	{
		return type;
	}
	

}
